PDF Xpress for ActiveX - User Guide > How To > Modify PDF Document Content > Create & Delete Thumbnails |
Within a PDF document, each page may have zero or one thumbnail images associated with it. These thumbnails are stored within the PDF document. PDF Xpress™ can be used to create or delete thumbnails within the PDF document.
Thumbnails can be created on a specified page from image information accessed from file, handle, memory, or ImageDataInfo object. To create a thumbnail use the "CreateThumbnailFrom" methods: CreateThumbnailFromData, CreateThumbnailFromFile, CreateThumbnailFromHandle, or CreateThumbnailFromMemory.
VB Example |
Copy Code
|
---|---|
'This code demonstrates creating thumbnails On Error GoTo error Dim pdfXpress1 As New PdfXpress pdfXpress1.Initialize pdfxpress1.RaiseExceptions = True Dim document As New PdfDocument document. SetParentControl pdfXpress1 document.OpenDocument "C:\test.pdf","" document.CreateThumbnailFromFile 0, "C:\testImage.jpg", 0 . . . GoTo finish error: MsgBox Err.Description finish: Set document = Nothing pdfxpress1.Terminate Set pdfxpress1= Nothing |
To delete a thumbnail on a specified page of the PDF document, call the DeleteThumbnail method.
VB Example |
Copy Code
|
---|---|
'This code demonstrates deleting thumbnails On Error GoTo error Dim pdfXpress1 As New PdfXpress pdfXpress1.Initialize pdfxpress1.RaiseExceptions = True Dim document As New PdfDocument document. SetParentControl pdfXpress1 document.OpenDocument "C:\test.pdf","" Dim pageNumber As Integer pageNumber = 0 document.DeleteThumbnail pageNumber . . . GoTo finish error: MsgBox Err.Description finish: Set document = Nothing pdfxpress1.Terminate Set pdfxpress1= Nothing |